package com.mpsc.api.unit;

import com.mpsc.api.bean.ArticleEntity;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class DateUtil {
    private static String DATE_FORMAT_I = "yyyy-MM-dd HH:mm:ss";

    public static void main(String[] args) {
        List<ArticleEntity> list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            list.add(new ArticleEntity());
        }
       //System.out.println(list.get(22));
        for (ArticleEntity a: list) {
            System.out.println(a.toString());
        }
    }


    /**
     * 将long 类型的数据转化为Date类型（yyyy-MM-dd HH:mm:ss）
     *
     * @param timeLong long类型的时间数据
     * @return Data
     */
    public static Date longToDate(Long timeLong) {
        //SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_I);
        Date date = new Date(timeLong);
        return date;
    }

}
